package conf2.ui;

import conf2.model.EActor.Side;
import java.awt.Color;
import java.awt.Image;
import javax.swing.ImageIcon;

public class ActorInfoPanel extends javax.swing.JPanel
{

    /** Creates new form ActorInfoPanel2 */
    public ActorInfoPanel(String name, String desc, int atkVal, Image image, Side side)
    {
        initComponents();

        setValues(name, desc, atkVal, image, side);
    }

    public void setValues(String name, String desc, int atkVal, Image image, Side side)
    {
        Color bg, fg, atk;
        if (side == Side.LIGHT) {
            bg = ColorSet.LIGHTCARD_BG;
            fg = ColorSet.LIGHTCARD_TEXT;
            atk = ColorSet.DARKCARD_BG;
        } else {
            bg = ColorSet.DARKCARD_BG;
            fg = ColorSet.DARKCARD_TEXT;
            atk = ColorSet.LIGHTCARD_BG;
        }

        setBackground(bg);
        centerPanel.setBackground(bg);
        nameLabel.setForeground(fg);
        descLabel.setForeground(fg);
        attackLabel.setForeground(atk);

        nameLabel.setText(name);
        descLabel.setText("<html>" + desc + "</html>");
        attackLabel.setText(String.valueOf(atkVal));

        picLabel.setIcon(new ImageIcon(image));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        nameLabel = new javax.swing.JLabel();
        descLabel = new javax.swing.JLabel();
        centerPanel = new javax.swing.JPanel();
        picLabel = new javax.swing.JLabel();
        attackLabel = new javax.swing.JLabel();

        setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        setLayout(new java.awt.GridBagLayout());

        nameLabel.setFont(FontSet.getActorviewerName());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10);
        add(nameLabel, gridBagConstraints);

        descLabel.setFont(FontSet.getActorviewerText());
        descLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        descLabel.setMinimumSize(new java.awt.Dimension(34, 80));
        descLabel.setPreferredSize(new java.awt.Dimension(34, 80));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 0.5;
        gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
        add(descLabel, gridBagConstraints);

        centerPanel.setLayout(new java.awt.GridLayout(1, 0));

        picLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        picLabel.setMinimumSize(new java.awt.Dimension(100, 100));
        picLabel.setPreferredSize(new java.awt.Dimension(100, 100));
        centerPanel.add(picLabel);

        attackLabel.setFont(FontSet.getActorviewerAttackValue());
        attackLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        centerPanel.add(attackLabel);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 0.5;
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10);
        add(centerPanel, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel attackLabel;
    private javax.swing.JPanel centerPanel;
    private javax.swing.JLabel descLabel;
    private javax.swing.JLabel nameLabel;
    private javax.swing.JLabel picLabel;
    // End of variables declaration//GEN-END:variables
}
